<template>
	<div>
		<h1>校名：{{ name }}</h1>
		<button @click="sendInfo">向父组件发送信息</button>
	</div>
</template>

<script>
	export default {
		name: "School",
		components: {},
		data() {
			return {
				name: "清华大学",
			};
		},
		methods: {
			sendInfo() {
				// 子组件中触发自定义事件
				this.$emit("sendName", this.name)
			}
		}
	};
</script>

<style>
</style>